<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../css/modules/layui/css/layui.css">
  <link rel="stylesheet" href="../css/useravatar.css">
  <link href="https://cdn.bootcdn.net/ajax/libs/cropperjs/1.5.12/cropper.min.css" rel="stylesheet">
</head>
<body>
  <!-- 卡片区域 -->
  <div class="layui-card">
    <div class="layui-card-header">更换头像</div>
    <div class="layui-card-body">
      <!-- 第一行的图片裁剪和预览区域 -->
      <div class="row1">
        <!-- 图片裁剪区域 -->
        <div class="cropper-box">
          <!-- 这个img 标签很重要，将来会把它初始化为裁剪区域 -->
          <img id="image" src="../img/zhihu.png">
        </div>
        <!-- 图片预览区域 -->
        <div class="preview-box">
          <div>
            <!-- 宽高为100px的预览区域 -->
            <div class="img-preview w100"></div>
            <p class="size">100 * 100</p>
          </div>
          <div>
            <!-- 宽高为50px的预览区域 -->
            <div class="img-preview w50"></div>
            <p class="size">50 * 50</p>
          </div>
        </div>
      </div>
      <!-- 第二行的按钮区域 -->
      <div class="row2">
        <input type="file" id="file" accept="image/png,image/jpeg,image/jpg">
        <button type="button" class="layui-btn btnChooseImage">上传</button>
        <button type="button" class="layui-btn layui-btn-danger btnQ">确定</button>
      </div>
    </div>
  </div>
</body>
<script src="../css/modules/layui/layui.js"></script>
<script src="../js/modules/jquery.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/cropperjs/1.5.12/cropper.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery-cropper/1.0.1/jquery-cropper.min.js"></script>
<script src="../js/baseAPI.js"></script>
<script src="../js/useravatar.js"></script>
</html>